import { constantRoutes } from '@/router'
export default {
  namespaced: true,
  state: {
    routers: []
  },
  mutations: {
    /**
     *
     * @param {*} state state
     * @param {*} userAsyncRouters 当前登录人可以访问的页面的路由配置
     */
    setMenuList (state, userAsyncRouters) {
      // 菜单数据 = 静态路由 + 根据权限动态追加
      state.routers = [...constantRoutes, ...userAsyncRouters]
    }
  }
}
